const env = process.env.NODE_ENV
const config = {
    httpUrl: () => {
        let url = {
            development: 'http://wxdcltqd.bgyfoodom.com',
            // development: 'http://192.168.8.101:8700/',
            // test: 'http://wxdcgzh.bywrc.com',
            // production: 'http://wxdcgzh.bywrc.com',
            test: 'http://119.23.72.156:8700',
            production: 'http://119.23.72.156:8700',
        }
        return  url[env]
    },
    kafkaUrl: () => {
        let url = {
            development: '47.106.228.172:29092',
            test: '47.106.228.172:29092',
            production: '47.106.104.168:29092,39.108.215.198.29092,120.79.77.240:29092'
        }
        return url[env];
    },
    dbUrl: () => {
        let url = {
            development: 'mongodb://localhost:27017/sms',
            test: 'mongodb://localhost:27017/sms',
            production: 'mongodb://localhost:17017/sms',
        }
        return url[env];
    },
    // 蛋糕机、饮料机对应PLC ip地址： [蛋糕机，饮料机] 
    PLCip: () => {
        // let url = ['::ffff:127.0.0.1','::ffff:172.29.3.112']
        let url = ['::ffff:192.168.3.200']
        return url[env];
    },
    // 每个窗口topic  [{蛋糕机内窗口},{蛋糕机外窗口},{饮料机内窗口},{饮料机外窗口}]
    machineTopic: () => {
        let url = [{ topic: 'CAKE_1206392905116295170' }, { topic: 'CAKE_1206393164416557057' }, { topic: 'node2' }];
        return url[env];
    },
    // 表情屏ip、端口
    faceIp: () => {
        let url = {
                host : '172.29.3.235',
                port : 19898
            };
        return url[env];
    },
    scanIp: () => {
        // let ipList = {
        //     intake1: '::ffff:192.168.127.253',
        //     intake2: '::ffff:192.168.127.254'
        // }
        // let ipList = {
        //     intake1: '::ffff:169.254.242.147',
        // }
        let ipList = {
            intake1: '::ffff:192.168.3.88',
            intake2: '::ffff:192.168.3.99',
        }
        
        return ipList;
    }
};
module.exports = config;
